# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=labplot
pkgver=2.10.0
pkgrel=2
arch=(loong64 x86_64)
pkgdesc='KDE Application for interactive graphing and analysis of scientific data'
url='https://labplot.kde.org/'
license=(GPL2)
depends=(cantor netcdf cfitsio fftw gsl qt5-serialport libcerf qt5-mqtt kuserfeedback
         discount libmatio liborigin readstat qxlsx-qt5 vector-blf)
makedepends=(extra-cmake-modules kdoctools dbc-parser-cpp)
source=(https://download.kde.org/stable/$pkgname/$pkgname-$pkgver.tar.xz
        find-qxlsx.patch)
sha256sums=('5dfc674310904a43875d69e3e260a1fedd968e6c1b1ecdaba755ab1aa38cba90'
            '3a7f08e6f2c2092628294a5b2c9f137ae04a43d04f7e342f860b04ebcd7af21c')

prepare() {
  patch -d $pkgname-$pkgver -p1 < find-qxlsx.patch
}

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DENABLE_TESTS=OFF \
    -DLOCAL_DBC_PARSER=OFF \
    -DLOCAL_VECTOR_BLF=OFF
  cmake --build build
}

package(){
  DESTDIR="$pkgdir" cmake --install build
}
